<pre>
<p>
                                                              dialogs:  shp2dta
<b><u>Title</u></b>
<p>
   <b>shp2dta</b> --  Converts shape boundary files to Stata datasets
<p>
<a name="syntax"></a><b><u>Syntax</u></b>
<p>
    <b>shp2dta</b> using <i>shpfilename</i><b>,</b> <b><u>data</u></b><b>base(</b><i>filename</i><b>)</b> <b><u>coor</u></b><b>dinates(</b><i>filename</i><b>)</b>
                [<i>options</i>]
<p>
    <i>options</i>                    Description
    -------------------------------------------------------------------------
    Main
      <b><u>data</u></b><b>base(</b><i>filename</i><b>)</b>       Specifies filename of new dBase dataset
      <b><u>coor</u></b><b>dinates(</b><i>filename</i><b>)</b>    Specifies filename of new coordinates dataset
      <b>replace</b>                  Overwrites existing database and coordinates
                                 filenames
      <b>genid(</b><i>newvarname</i><b>)</b>        Creates unique <i>id</i> variable for <i>database</i>.dta
      <b><u>genc</u></b><b>entroids(</b><i>stub</i><b>)</b>       Creates centroid variables
    -------------------------------------------------------------------------
<p>
    If <i>shpfilename</i> is specified without an extension, <b>.shp</b> is assumed.
    If <i>filename</i> is specified without an extension, <b>.dta</b> is assumed.
    Windows and Macintosh users:  if <i>shpfilename</i> or <i>filename</i> contains
      embedded spaces, remember to enclose them in double quotes.
<p>
<p>
<a name="description"></a><b><u>Description</u></b>
<p>
    <b>shp2dta</b> reads a shape (.shp) and dBase (.dbf) file from disk and converts
    them into Stata datasets.  The shape and dBase files must have the same
    name and be saved in the same directory.  The user-written command <b>tmap</b>
    can use the two datasets that <b>shp2dta</b> creates.<b>  shp2dta</b> can convert only
    point, line, and polygon shapefiles (type 1, 3, and 5).
<p>
<p>
<a name="options"></a><b><u>Options</u></b>
<p>
        +------+
    ----+ Main +-------------------------------------------------------------
<p>
    <b>database(</b><i>filename</i><b>)</b> specifies the name of the new Stata dataset to contain
        the .dbf file data.  This option is required.
<p>
    <b>coordinates(</b><i>filename</i><b>)</b> specifies the name of the new Stata dataset to
        contain the .shp file data.  This option is required.
<p>
    <b>replace</b> overwrites any existing Stata dataset with the names specified in
        the <b>database(</b><i>filename</i><b>)</b> and <b>coordinates(</b><i>filename</i><b>)</b> options.
<p>
    <b>genid(</b><i>newvarname</i><b>)</b> specifies the name of the new numeric variable that, in
        file <i>database</i>.dta, will uniquely identify the different geographical
        areas of interest.  The values taken on by <i>newvarname</i> will correspond
        to the values taken on by variable _ID in file <i>coordinates</i>.dta.
<p>
    <b>gencentroids(</b><i>stub</i><b>)</b> requests that the coordinates of the centroids of the
        geographical areas of interest be computed, stored in variables
        x_<i>stub</i> and y_<i>stub</i>, and added to file <i>database</i>.dta.  You must also
        specify the <b>genid(</b><i>newvarname</i><b>)</b> option.
<p>
<p>
<a name="examples"></a><b><u>Examples</u></b>
<p>
    To demonstrate the use of <b>shp2dta</b> let's suppose we have two files,
    <b>asia.dbf</b> and <b>asia.shp</b>, in our current working directory.  Two convert
    these files to two Stata datasets we type:
<p>
        <b>. shp2dta using asia, data("asia_data") </b> <b>coor("asia_coordinates")</b>
<p>
    In the current working directory we now have two files, <b>asia_data.dta</b> and
    <b>asia_coordinates.dta</b>, that have the converted data.
<p>
<a name="author"></a><b><u>Author</u></b>
<p>
    Kevin Crow
    StataCorp L.P.
    kcrow@stata.com
</pre>